<template>
  <full-dialog :visible.sync="visible" :fullscreen.sync="fullscreen" title="签核" width="80%" @closed="reset" class="approve-dialog">
    <approve ref="approve" @success="success" @close="close"></approve>
  </full-dialog>
</template>

<script>
import Approve from "./approve";

export default {
  name: "ApproveDialog",
  components: {
    Approve
  },
  data() {
    return {
      visible: false,
      fullscreen: true,
    }
  },
  methods: {
    init(flowId, orders) {
      this.visible = true;
      this.$nextTick(() => {
        this.$refs.approve.init(flowId, orders);
      });
    },
    success() {
      this.close();
      this.$emit('success');
    },
    close() {
      this.visible = false;
    },
    // 表单重置
    reset() {
      this.$refs.approve.reset();
    }
  }
}
</script>

<style scoped lang="scss">
.approve-dialog {
  & ::v-deep .el-dialog__body {
    padding-bottom: 0;
  }
}
</style>
